package com.spring.boot.demo.pojo;

import javax.validation.constraints.Email;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
import java.io.Serializable;

/**
 * @author ZhuYouBin
 * @version 1.0.0
 * @Date: 2022/10/29 21:45
 * @Description
 */
public class User implements Serializable {

    @NotBlank(message = "用户名称不能为空")
    @Size(min = 1, max = 50, message = "用户名称长度必须在1到50之间")
    private String username;

    @NotBlank(message = "用户密码不能为空")
    @Size(min = 1, max = 30, message = "用户密码长度必须在1到30之间")
    private String password;

    @NotBlank(message = "邮箱不能为空")
    @Email(message = "邮箱格式不正确")
    private String email;

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    @Override
    public String toString() {
        return "User{" +
                "username='" + username + '\'' +
                ", password='" + password + '\'' +
                ", email='" + email + '\'' +
                '}';
    }
}
